<%-- 
    Document   : insertBoardForm.jsp
    Created on : 2012. 4. 20, 오후 3:33:20
    Author     : jeong
--%>

<%@page import="com.webproject.jsp.board.BoardManager"%>
<%@page import="com.webproject.jsp.common.CommonUtil"%>
<%@page import="com.webproject.jsp.board.model.Board"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%

    String num = CommonUtil.strChkNull(request.getParameter("selectedNum"),"");
    String title = CommonUtil.strChkNull(request.getParameter("title"),"");
    String content = CommonUtil.strChkNull(request.getParameter("content"),"");
    String password = CommonUtil.strChkNull(request.getParameter("password"),"");
    
    System.out.println(">>> selectedNum is " + num);   
    System.out.println(">>> title is " + title);
    System.out.println(">>> content is " + content);
    System.out.println(">>> password is " + password);    
%>
<script language="javascript">
    
    $(document).ready(function() {
        
        $('#sendFormBtn').click(function() {
             
            var frm = $('form#frm');
            var url = "/webproj/board/updateBoard.jsp";
            
            $('form#frm').attr("action",url);
            
            frm.submit();
            
          });
          
        $('#cancel').click(function() {
            
            location.href = "/webproj/board/listBoardView.jsp";
        });
          
    });
     
</script>
<form name="frm" id="frm" method="POST">
<input type="hidden" name="selectedNum" id="selectedNum" value="<%=num%>" />
    <div id="main">
        <table cellspacing="1" cellpadding="1" border="0">
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td>제목</td><td>&nbsp;</td><td><input type="text" name="title" id="title" value="<%=title%>" maxlength="10"/></td>
            </tr>
            <tr>
                <td>내용</td><td>&nbsp;</td><td><textarea name="content" id="content" maxlength="2000"><%=content%></textarea></td>
            </tr>
            <tr>
                <td>비밀번호</td><td>&nbsp;</td><td><input type="password" name="password" id="password" value="password" /></td>
            </tr>
            <tr>
                <td><input type="button" name="cancel" id="cancel" value="취소" /></td><td><input type="button" name="sendFormBtn" id="sendFormBtn" value="저장"/></td>
            </tr>
        </table>
    </div>
</form>

